﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Tanmia.Core;
using FluentNHibernate.Mapping;

namespace Tanmia.NHibernate.Mapping
{
    public class VoucherDetailMap : ClassMap<VoucherDetail>
    {
        public VoucherDetailMap()
        {
            Table("VoucherDetail");

            Id(x => x.VoucherDetailID).Not.Nullable().GeneratedBy.Identity();

            Map(x => x.Debit).Not.Nullable().Default("0");
            Map(X => X.Credit).Not.Nullable().Default("0");
            Map(X => X.Notes).Nullable();

            References(X => X.Account, "AccountID").Not.Nullable();
        }
    }
}
